package com.util.result;

import lombok.Data;

/**
 * @Description 判断结果
 * @Author zhu_jinsheng[zhu_js@suixingpay.com]
 * @Date 2020/4/14 20:26
 * @Version 1.0
 */
@Data
public class JudgeResult{
    Boolean result;
    String message;

    public JudgeResult(Boolean result, String message) {
        this.result = result;
        this.message = message;
    }

    /**
     * 成功
     * @return
     */
    public static JudgeResult success() {
        return new JudgeResult(true, "成功");
    }
    public static JudgeResult success(String message) {
        return new JudgeResult(true, message);
    }

    /**
     * 失败
     * @return
     */
    public static JudgeResult error() {
        return new JudgeResult(false, "失败");
    }
    public static JudgeResult error(String message) {
        return new JudgeResult(false, message);
    }
}
